Skip to content

Refactor icons to use fill="variant" prop instead of a separate icon - #4134

Merged
steven-tey merged 5 commits into
mainfrom
icon-fill-variant
Jul 6, 2026
Merged

Refactor icons to use fill="variant" prop instead of a separate icon#4134
steven-tey merged 5 commits into
mainfrom
icon-fill-variant

Conversation

@steven-tey

@steven-tey steven-tey commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Updated a wide range of UI badges, status icons, and indicators to use the shared filled/outline icon styling (via variant="fill"), improving consistency across dashboards, onboarding, navigation, embeds, and modals.
  • Refactor
    • Migrated the icon system toward variant-based rendering and added a shared filled-variant wrapper for icons that need filled styling.
    • Simplified the network empty-state API by removing the optional variant parameter.
  • Chores
    • Bumped the UI package version to 0.3.5.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Jul 6, 2026 9:05pm

Request Review

@steven-tey
steven-tey marked this pull request as ready for review July 6, 2026 20:03
@steven-tey

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review, any breaking changes?

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@steven-tey Sure, kicking off a full review of all the changes now. Once it completes, I'll flag any potential breaking changes I find — particularly around whether the icon components' public prop API (e.g., any consumers passing the old separate icon variant props) changed in a way that could affect external usage. I'll follow up with details in the review comments.

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea446f72-73be-4e1a-94b0-920a553e704a

📥 Commits

Reviewing files that changed from the base of the PR and between ba9a6d9 and 360e6aa.

📒 Files selected for processing (2)
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/register/page.tsx
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/subdomain/page.tsx
💤 Files with no reviewable changes (1)
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/register/page.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/subdomain/page.tsx

📝 Walkthrough

Walkthrough

This PR migrates icon usage from dedicated filled components to variant-based icons across packages/ui and multiple app consumers. It adds a fill-variant helper, updates icon implementations and exports, removes legacy filled icon files, and rewires affected UI call sites.

Changes

Icon fill-variant migration

Layer / File(s) Summary
Fill-variant infrastructure and package version
packages/ui/src/icons/with-fill-variant.tsx, packages/ui/src/icons/index.tsx, packages/ui/package.json, packages/ui/src/icons/nucleo/*
Adds withFillVariant, re-exports it from the icons index, bumps packages/ui to 0.3.5, and updates many nucleo icons to support variant="fill".
Removed legacy filled icon files and barrel exports
packages/ui/src/icons/nucleo/*-fill.tsx, .../checkbox-unchecked.tsx, packages/ui/src/icons/nucleo/index.ts
Removes standalone filled icon modules and updates the nucleo barrel exports to drop the legacy filled re-exports.
Navigation content and shared renderers
packages/ui/src/content.ts, packages/ui/src/nav/content/{resources-content,solutions-content}.tsx, packages/ui/src/card-selector.tsx, packages/ui/src/combobox/index.tsx
Navigation data and shared components switch to base icons with withFillVariant, variant="fill", or CheckboxIcon.
Onboarding domain selector wiring
apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/*
Onboarding pages construct badge icons via withFillVariant(Bolt) and withFillVariant(CircleCheck).
Verified badge usage sites
apps/web/app/(ee)/admin.dub.co/.../{fraud,trusted}/*, apps/web/app/app.dub.co/.../network-partner-card.tsx, apps/web/ui/{integrations/integration-status-badge,partners/partner-network/partner-network-status-badge,partners/partner-platform-card,partners/partner-social-column,partners/partner-platforms-form}.tsx
Verified and approved badges render BadgeCheck2 with variant="fill" instead of the removed filled components.
CircleCheck usage sites
reward, invite, modal, discount, password, application, and bounty checklist UIs
Selection and completion checkmarks render CircleCheck with variant="fill".
Flag, Star, Bolt, Msgs, and network UI usage sites
fraud risk banners/indicators, inspect card, star buttons, network empty-state/page-client, apply success page, chat bubble
Consumer components render Flag, Star, Bolt, and Msgs with variant="fill" instead of dedicated filled icons.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • dubinc/dub#3988: Both PRs modify apps/web/ui/partners/partner-network/partner-network-status-badge.tsx around the approved badge icon rendering.
  • dubinc/dub#4041: Both PRs touch apps/web/ui/integrations/integration-status-badge.tsx, updating the verified integration badge/tooltip to use BadgeCheck2 with variant="fill".
  • dubinc/dub#4062: Both PRs touch packages/ui/package.json by bumping the UI package version field.

Suggested reviewers: pepeladeira

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: consolidating separate filled icons into variant-based icon components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch icon-fill-variant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/ui/src/content.ts (1)

154-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Redundant withFillVariant wrap on the "About" entry.

icon: withFillVariant(Users) forces variant="fill" unconditionally, but this entry is only ever rendered via resources-content.tsx's Company section, which already passes variant="fill" explicitly to every icon in that loop (see resources-content.tsx lines 99-102). Sibling entries in the same RESOURCES array — Careers (Briefcase), Blog (Feather), Changelog (BulletList), Contact (Envelope) — correctly use the plain, unwrapped icon and rely on the caller's variant="fill". The "About" entry is the outlier; wrapping it here is redundant and inconsistent with its siblings, even though it doesn't currently cause a visible bug.

♻️ Align "About" with its siblings
   {
-    icon: withFillVariant(Users),
+    icon: Users,
     title: "About",
     description: "Company, values, and team",
     href: "/about",
   },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/content.ts` around lines 154 - 159, The “About” resource
entry is redundantly wrapped with withFillVariant even though
resources-content.tsx already passes variant="fill" for the Company section.
Update the About item in content.ts to use the plain Users icon like the other
RESOURCES entries (e.g. Briefcase, Feather, BulletList, Envelope) and let the
caller control the fill variant consistently.
packages/ui/src/icons/nucleo/badge-check2.tsx (1)

3-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the repeated variant prop type.

The { variant?: "outline" | "fill" } intersection type is duplicated verbatim across ~24 icon components in this migration (Bolt, Book2, Briefcase, BulletList, Gift, Heart, etc.). Extracting a shared IconVariantProps type (e.g. in a common icons types module) would reduce duplication and make future variant additions a single-point change.

♻️ Example shared type
// packages/ui/src/icons/types.ts
import { SVGProps } from "react";

export type IconVariant = "outline" | "fill";
export type VariantIconProps = SVGProps<SVGSVGElement> & {
  variant?: IconVariant;
};
-export function BadgeCheck2({
-  variant = "outline",
-  ...props
-}: SVGProps<SVGSVGElement> & { variant?: "outline" | "fill" }) {
+export function BadgeCheck2({
+  variant = "outline",
+  ...props
+}: VariantIconProps) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/icons/nucleo/badge-check2.tsx` around lines 3 - 6, The
`BadgeCheck2` component repeats the same `variant?: "outline" | "fill"` prop
shape used by many icon components, so extract this into a shared icon
props/type definition and update `BadgeCheck2` to use it. Add a common
`IconVariant`/`VariantIconProps` type in the shared icons types module, then
replace the inline intersection type in `BadgeCheck2` (and matching icons like
Bolt, Book2, Briefcase, BulletList, Gift, Heart) with that shared type to keep
variant handling centralized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/icons/with-fill-variant.tsx`:
- Around line 8-10: The FillIcon helper in with-fill-variant.tsx is letting
callers override the forced fill variant because props are spread after
variant="fill". Update FillIcon so the forced variant cannot be replaced by
incoming props, keeping the explicit fill value applied in the Icon wrapper and
ensuring variant is not taken from ComponentProps<VariantIcon>.

---

Nitpick comments:
In `@packages/ui/src/content.ts`:
- Around line 154-159: The “About” resource entry is redundantly wrapped with
withFillVariant even though resources-content.tsx already passes variant="fill"
for the Company section. Update the About item in content.ts to use the plain
Users icon like the other RESOURCES entries (e.g. Briefcase, Feather,
BulletList, Envelope) and let the caller control the fill variant consistently.

In `@packages/ui/src/icons/nucleo/badge-check2.tsx`:
- Around line 3-6: The `BadgeCheck2` component repeats the same `variant?:
"outline" | "fill"` prop shape used by many icon components, so extract this
into a shared icon props/type definition and update `BadgeCheck2` to use it. Add
a common `IconVariant`/`VariantIconProps` type in the shared icons types module,
then replace the inline intersection type in `BadgeCheck2` (and matching icons
like Bolt, Book2, Briefcase, BulletList, Gift, Heart) with that shared type to
keep variant handling centralized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 200e388b-7571-4c96-8763-a03c9f4d5ff9

📥 Commits

Reviewing files that changed from the base of the PR and between d7018bf and 8cbc483.

📒 Files selected for processing (91)
  • apps/web/app/(ee)/admin.dub.co/(dashboard)/partners/fraud/review-fraud-alert-sheet.tsx
  • apps/web/app/(ee)/admin.dub.co/(dashboard)/partners/trusted/page.tsx
  • apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/rewards/form.tsx
  • apps/web/app/(ee)/app.dub.co/embed/referrals/bounties/submission-fields.tsx
  • apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/network-approval-guide.tsx
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/invite/page.tsx
  • apps/web/app/[domain]/[key]/inspect/card.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/add-edit-group-additional-link-modal.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/group-link-settings.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/network/network-empty-state.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/network/network-partner-card.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/network/page-client.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/success/page-client.tsx
  • apps/web/app/app.dub.co/(invites)/[slug]/invite/page.tsx
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/default-domain-selector.tsx
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/register/page.tsx
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/subdomain/page.tsx
  • apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/program/reward/form.tsx
  • apps/web/ui/integrations/integration-status-badge.tsx
  • apps/web/ui/modals/link-conversion-tracking-modal.tsx
  • apps/web/ui/partners/bounties/bounty-social-content.tsx
  • apps/web/ui/partners/discounts/add-edit-discount-sheet.tsx
  • apps/web/ui/partners/fraud-risks/partner-risk-banner.tsx
  • apps/web/ui/partners/fraud-risks/partner-risk-indicator.tsx
  • apps/web/ui/partners/partner-network/partner-network-status-badge.tsx
  • apps/web/ui/partners/partner-platform-card.tsx
  • apps/web/ui/partners/partner-platforms-form.tsx
  • apps/web/ui/partners/partner-social-column.tsx
  • apps/web/ui/partners/partner-star-button.tsx
  • apps/web/ui/partners/program-application-sheet.tsx
  • apps/web/ui/shared/password-requirements.tsx
  • apps/web/ui/support/chat-bubble.tsx
  • packages/ui/package.json
  • packages/ui/src/card-selector.tsx
  • packages/ui/src/combobox/index.tsx
  • packages/ui/src/content.ts
  • packages/ui/src/icons/index.tsx
  • packages/ui/src/icons/nucleo/badge-check2-fill.tsx
  • packages/ui/src/icons/nucleo/badge-check2.tsx
  • packages/ui/src/icons/nucleo/bolt-fill.tsx
  • packages/ui/src/icons/nucleo/bolt.tsx
  • packages/ui/src/icons/nucleo/book2-fill.tsx
  • packages/ui/src/icons/nucleo/book2.tsx
  • packages/ui/src/icons/nucleo/briefcase-fill.tsx
  • packages/ui/src/icons/nucleo/briefcase.tsx
  • packages/ui/src/icons/nucleo/bullet-list-fill.tsx
  • packages/ui/src/icons/nucleo/bullet-list.tsx
  • packages/ui/src/icons/nucleo/caret-up-fill.tsx
  • packages/ui/src/icons/nucleo/caret-up.tsx
  • packages/ui/src/icons/nucleo/checkbox-checked-fill.tsx
  • packages/ui/src/icons/nucleo/checkbox-unchecked.tsx
  • packages/ui/src/icons/nucleo/checkbox.tsx
  • packages/ui/src/icons/nucleo/circle-check-fill.tsx
  • packages/ui/src/icons/nucleo/circle-check.tsx
  • packages/ui/src/icons/nucleo/circle-play-fill.tsx
  • packages/ui/src/icons/nucleo/circle-play.tsx
  • packages/ui/src/icons/nucleo/connected-dots-fill.tsx
  • packages/ui/src/icons/nucleo/connected-dots.tsx
  • packages/ui/src/icons/nucleo/cube-settings-fill.tsx
  • packages/ui/src/icons/nucleo/cube-settings.tsx
  • packages/ui/src/icons/nucleo/diamond-turn-right-fill.tsx
  • packages/ui/src/icons/nucleo/diamond-turn-right.tsx
  • packages/ui/src/icons/nucleo/envelope-fill.tsx
  • packages/ui/src/icons/nucleo/envelope.tsx
  • packages/ui/src/icons/nucleo/feather-fill.tsx
  • packages/ui/src/icons/nucleo/feather.tsx
  • packages/ui/src/icons/nucleo/flag-fill.tsx
  • packages/ui/src/icons/nucleo/flag.tsx
  • packages/ui/src/icons/nucleo/gift-fill.tsx
  • packages/ui/src/icons/nucleo/gift.tsx
  • packages/ui/src/icons/nucleo/heart-fill.tsx
  • packages/ui/src/icons/nucleo/heart.tsx
  • packages/ui/src/icons/nucleo/index.ts
  • packages/ui/src/icons/nucleo/life-ring-fill.tsx
  • packages/ui/src/icons/nucleo/life-ring.tsx
  • packages/ui/src/icons/nucleo/lock-fill.tsx
  • packages/ui/src/icons/nucleo/lock.tsx
  • packages/ui/src/icons/nucleo/microphone-fill.tsx
  • packages/ui/src/icons/nucleo/microphone.tsx
  • packages/ui/src/icons/nucleo/msgs-fill.tsx
  • packages/ui/src/icons/nucleo/msgs.tsx
  • packages/ui/src/icons/nucleo/star-fill.tsx
  • packages/ui/src/icons/nucleo/star.tsx
  • packages/ui/src/icons/nucleo/toggle2-fill.tsx
  • packages/ui/src/icons/nucleo/toggle2.tsx
  • packages/ui/src/icons/nucleo/users-fill.tsx
  • packages/ui/src/icons/nucleo/users.tsx
  • packages/ui/src/icons/with-fill-variant.tsx
  • packages/ui/src/nav/content/resources-content.tsx
  • packages/ui/src/nav/content/solutions-content.tsx
💤 Files with no reviewable changes (25)
  • packages/ui/src/icons/nucleo/lock-fill.tsx
  • packages/ui/src/icons/nucleo/toggle2-fill.tsx
  • packages/ui/src/icons/nucleo/microphone-fill.tsx
  • packages/ui/src/icons/nucleo/connected-dots-fill.tsx
  • packages/ui/src/icons/nucleo/bolt-fill.tsx
  • packages/ui/src/icons/nucleo/circle-check-fill.tsx
  • packages/ui/src/icons/nucleo/gift-fill.tsx
  • packages/ui/src/icons/nucleo/badge-check2-fill.tsx
  • packages/ui/src/icons/nucleo/checkbox-checked-fill.tsx
  • packages/ui/src/icons/nucleo/bullet-list-fill.tsx
  • packages/ui/src/icons/nucleo/msgs-fill.tsx
  • packages/ui/src/icons/nucleo/users-fill.tsx
  • packages/ui/src/icons/nucleo/envelope-fill.tsx
  • packages/ui/src/icons/nucleo/star-fill.tsx
  • packages/ui/src/icons/nucleo/briefcase-fill.tsx
  • packages/ui/src/icons/nucleo/life-ring-fill.tsx
  • packages/ui/src/icons/nucleo/book2-fill.tsx
  • packages/ui/src/icons/nucleo/heart-fill.tsx
  • packages/ui/src/icons/nucleo/feather-fill.tsx
  • packages/ui/src/icons/nucleo/checkbox-unchecked.tsx
  • packages/ui/src/icons/nucleo/caret-up-fill.tsx
  • packages/ui/src/icons/nucleo/flag-fill.tsx
  • packages/ui/src/icons/nucleo/circle-play-fill.tsx
  • packages/ui/src/icons/nucleo/cube-settings-fill.tsx
  • packages/ui/src/icons/nucleo/diamond-turn-right-fill.tsx

Comment thread packages/ui/src/icons/with-fill-variant.tsx
@steven-tey
steven-tey merged commit 30105c5 into main Jul 6, 2026
11 checks passed
@steven-tey
steven-tey deleted the icon-fill-variant branch July 6, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant